package ui.magic.magicui;

import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import ui.magic.magiclibs.container.Frame.FrameMagicUi;

public class FrameActivity extends AppCompatActivity implements View.OnClickListener{

    private FrameMagicUi layout;
    private Button btn;
    private Button btn1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_frame);
        layout=(FrameMagicUi) findViewById(R.id.frame_layout);
        init();
    }

    public void init(){
        btn=new Button(layout.getContext());
        btn.setBackgroundColor(Color.BLUE);
        layout.addChild(btn,50,50);
        btn1=new Button(layout.getContext());
        btn1.setBackgroundColor(Color.DKGRAY);
        btn.setOnClickListener(this);
        layout.addChild(btn1,30,30);
    }

    @Override
    public void onClick(View v) {
//        Intent intent=new Intent(FrameActivity.this,AbsoluteActivity.class);
//        FrameActivity.this.startActivity(intent);
        layout.changeChildSize(btn,30,30);
    }
}
